<template>
	<view class="homeLayout pageBg">
		<!-- 轮播图 -->
		<view class="banner">
			<swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" indicator-color="rgba(255, 255, 255, 0.5)"
				indicator-active-color="#fff">
				<swiper-item v-for="item in 3" class="swiper-item">
					<image src="/common/images/banner2.jpg" mode="aspectFill" class="banner-image"></image>
				</swiper-item>
			</swiper>
		</view>
		<!-- 公告 -->
		<view class="notice">
			<view class="left flex-center">
				<uni-icons type="sound-filled" size="20"></uni-icons>
				<text class="text">公告</text>
			</view>
			<view class="center">
				<swiper :autoplay="true" circular vertical>
					<swiper-item v-for="item in 3">
						<text class="ellipse text">阿斯卡很发达随机发货洒基发撒合法阿斯卡很发达随机发货洒基发撒合法</text>
					</swiper-item>
				</swiper>
			</view>
			<view class="right flex-center">
				<uni-icons type="right" size="16" color="#333"></uni-icons>
			</view>
		</view>
		
		<!-- 每日推荐 -->
		<view class="select">
			<common-title title="每日推荐">
				<template #rightCustom>
					<uni-icons type="calendar" size="18"></uni-icons>
					<uni-dateformat :date="Date.now()" format="dd日" class="dateformat"></uni-dateformat>
				</template>
			</common-title>
			<scroll-view scroll-x="true">
				<view class="box">
					<image class="select-image" v-for="item in 8" src="/common/images/preview_small.webp" mode="aspectFill"></image>
				</view>
			</scroll-view>
		</view>
		
		<!-- 专题精选 -->
		<view class="theme">
			<common-title title="专题精选">
				<template #rightCustom>
					<navigator url="" class="more">More+</navigator>
				</template>
			</common-title>
			<view class="content">
				<theme-item v-for="item in 8"></theme-item>
				<theme-item :is-more="true"></theme-item>
			</view>
		</view>
	</view>
</template>

<script setup>
	
</script>

<style lang="scss" scoped>
.homeLayout {
	.banner {
		padding: 30rpx 0;
		width: 750rpx;
		swiper {
			.swiper-item {
				width: 100%;
				.banner-image {
					width: 100%;
					height: 340rpx;
					padding: 0 30rpx;
				}
			}
		}
	}
	.notice {
		width: 690rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		height: 80rpx;
		background: #f9f9f9;
		border-radius: 40rpx;
		.left {
			width: 140rpx;
			.text {
				color: $brand-theme-color;
				font-weight: 600;
				font-size: 28rpx;
			}
			:deep(.uni-icons) {
				color: $brand-theme-color !important;
			}
		}
		.center {
			flex: 1;
			height: 100%;
			swiper {
				height: 100%;
				swiper-item {
					height: 100%;
					.text {
						height: 100%;
						width: 100%;
						display: block;
						line-height: 80rpx;
						color: #666;
					}
				}
			}
		}
		.right {
			width: 70rpx;
		}
	}
	.select {
		padding-top: 50rpx;
		:deep(.uni-icons) {
			color: $brand-theme-color !important;
		}
		.dateformat {
			margin-left: 5rpx;
			color: $brand-theme-color;
		}
		scroll-view {
			margin-left: 30rpx;
			margin-top: 30rpx;
			.box {
				display: flex;
				padding-right: 30rpx;
				.select-image {
					width: 200rpx;
					height: 430rpx;
					flex-shrink: 0;
					margin-right: 15rpx;
					border-radius: 10rpx;
					&:last-child {
						margin-right: 30rpx;
					}
				}
				&::after {
				    content: "";
				    flex-shrink: 0;
				    width: 30rpx;
				  }
			}
		}
	}
	.theme {
		padding: 50rpx 0;
		.more {
			font-size: 32rpx;
			color: #888;
		}
		.content {
			margin: 30rpx;
			display: grid;
			gap: 15rpx;
			grid-template-columns: repeat(3, 1fr);
		}
	}
}       
</style>
